extends Node

var db:SQLite = null
# Called when the node enters the scene tree for the first time.

func loadDb(db_path):
	db=SQLite.new()
	db.verbosity_level = SQLite.VERBOSE
	db.path=db_path	
	pass # Replace with function body.

# 打开数据库
func openDb():
	#db.read_only = true
	db.open_db()

# 关闭数据库
func closeDb():
	db.close_db()


# 查询表数据
func query_table_data(table_name):
	var selected_array : Array = db.select_rows(table_name, "1=1", ["*"]);
	return selected_array

# 根据条件查询数据
func query_table_condition(table_name,query_condition):
	var selected_array : Array = db.select_rows(table_name, query_condition, ["*"]);
	return selected_array


# 查询所有配置表数据
func query_all_config_table():
	var selected_array : Array = db.select_rows("sqlite_master", "type='table'", ["name"]);
	return selected_array

